home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 May
/
EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso
/
softwareupdate
/
system
/
amigados
/
amigadoslibrary
/
createdir.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-10-10
|
989b
|
46 lines
/* CreateDir.c V1.0 93-03-15 */
/* ROM library: "dos.library/CreateDir", (All versions) */
/* Copyright 1993, Anders Bjerin, Amiga C Club */
#include <dos/dos.h>
#include <clib/dos_protos.h>
#include <stdio.h>
#include <stdlib.h>
UBYTE *version = "$VER: CreateDir 1.0";
int main( int argc, char *argv[] );
int main( int argc, char *argv[] )
{
BPTR my_dir_lock;
/* Create a directory: */
my_dir_lock = CreateDir( "RAM:MyDirectory" );
/* OK? */
if( my_dir_lock == NULL )
{
/* We could not create the directory! */
printf( "Error! Could not create the new directory!\n" );
exit( 20 );
}
/* We have successfully created the directory! */
printf( "The directory was successfully created!\n" );
/* - - - */
/* As soon as you do not need the lock on the */
/* directory any more you should unlock it! */
UnLock( my_dir_lock );
/* Inform the user: */
printf( "Directory unlocked!\n" );
exit( 0 );
}